package package06章_面向对象编程_基础._09bean_uml;/**
 * ClassName: UserTest
 * Package: package06章_面向对象编程_基础._09bean_uml
 * Description:
 *
 * @Author lys
 * @Create 2024/2/17 10:45
 * @Version 1.0
 */

/**
 * @author lys
 * @version 1.0
 * @description: TODO
 * @date 2024/2/17 10:45
 */
public class UserTest {

    public static void main(String[] args) {
        User u1 = new User();

        System.out.println(u1.age);


        User u2 = new User(2);
        System.out.println(u2.age);
        u2.age = 3;
        u2.age = 4;
    }
}

class User {
    //属性(或实例变量)
    String name;
    int age = 10;

    public User() {
//        age = 20;
    }

    public User(int a) {
        age = a;
    }

}